package com.zengqingfa.examples.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.zengqingfa.examples.mybatisplus.annotation.LogCompare;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

/**
 * @fileName: User
 * @author: zengqf3
 * @date: 2020-8-1 14:12
 * @description:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class User {

    @TableId(type = IdType.ID_WORKER)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long id;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String name;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer age;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String email;

    @TableLogic
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer deleteFlag;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Date createTime;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Date updateTime;

    @TableField(fill = FieldFill.INSERT)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String createUserCode;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String updateUserCode;

    @Version
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer version;
}
